syntax on
set ruler
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set nu
set bs=indent
set fo-=r
set fileencodings=utf-8,gb2312,gbk,big5,gb18030,utf-16,utf-16le,utf-16be,iso-8859-1
set encoding=utf-8
set imdisable
set tabpagemax=30
filetype plugin on
nnoremap <F8> :TlistToggle<CR>
func! InsertTabWrapper()
    let col = col('.') - 1
    if !col || getline('.')[col - 1] !~ '\k'
        return "\<tab>"
    else
        return "\<c-p>"
    endif
endfunction
inoremap <TAB> <C-R>=InsertTabWrapper()<CR>
